<?php

function createConnection(){
	$dsn 	= "mysql:host=localhost;dbname=ConcurrencyTest";
	$uname 	= "root";
	$upass 	= "";
	return new PDO($dsn, $uname, $upass);
}

function getConnection(){
	static $conn;
	if(!$conn){
		try{
			 $conn = createConnection();
		}catch(PDOException $ex){
			echo $ex->getMessage();
		}
	}
	return $conn;
}